package STUDENT.NGUYENHUUTHANG.STRUCTURE_PROGRAMMING.EXAMPLES;

import java.util.Scanner;

public class dangky_ketban {

	public static void main(String[] args) {
		System.out.println("Chao mung ban tham gia dang ky ket ban, hay nhap cac thong tin sau:");
		System.out.println("Ten cua ban:");
		Scanner sc = new Scanner(System.in);
		String name = sc.nextLine();
		if (name.isEmpty()) {
			System.out.println("Ban chua nhap ten cua minh!");
		} else
			System.out.println("Tuoi cua ban:");
		String age = sc.nextLine();
		if (age.isEmpty()) {
			System.out.println("Ban chua nhap tuoi cua minh");
		} else
			System.out.println("Tinh trang hon nhan:");
		String marriage = sc.nextLine();
		if (marriage.isEmpty()||(marriage.equals("chua co gia dinh") == false && marriage.equals("da lap gia dinh") == false && marriage.equals("ly hon") == false)) {
			System.out.println("Ban chua nhap tinh trang hon nhan cua minh hoac nhap sai tinh trang hon nhan!");
		
		} else
			System.out.println("Gioi tinh cua ban:");
		
		String gender = sc.nextLine();
		if (gender.isEmpty()||(gender.equals("nam")==false&&gender.equals("nu")==false)) {
			System.out.println("Ban chua nhap gioi tinh cua minh hoac nhap sai gioi tinh");
		} else {
			int x = Integer.parseInt(age);
			if ((gender.equals("nam") && x >= 22)
					&& (marriage.equals("chua co gia dinh") || marriage.equals("ly hon"))) {
				System.out.println("Ket qua dang ky: Duoc phep tham gia");
			}
			if ((gender.equals("nu") && x >= 19)
					&& (marriage.equals("chua co gia dinh") || marriage.equals("ly hon"))) {
				System.out.println("Ket qua dang ky: Duoc phep tham gia");
			}
			if (x < 19) {
				System.out.println("Ket qua dang ky: Khong duoc phep tham gia");
			}
			if (marriage.equals("da lap gia dinh")) {
				System.out.println("Ket qua dang ky: Khong duoc phep tham gia");
			}
			if (marriage.equals("chua co gia dinh") == false && marriage.equals("da lap gia dinh") == false
					&& marriage.equals("ly hon") == false) {
				
			}

		}

	}
}
